package connection;

import java.io.IOException;
import java.net.Socket;

public class SimulatorConnectionIn extends ConnectionIn {

	public SimulatorConnectionIn(Socket socket, Relay relay) {
		super(socket, relay);
	}

	@Override
	protected void handleMessage() {
		try {
			int lane = dis.read();
			int lightState = dis.read();
			relay.addControllerMessage(new ControllerMessage(lane, lightState));
			System.out.println("Simulator incoming message: lane: " + lane + " lightState: " + lightState + " added to relay...");
		} 
		catch (IOException e) {
			e.printStackTrace();
		}		
	}
}
